home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / file_mgt / dir2db / seek.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-08-12  |  10.3 KB  |  330 lines

  1. VERSION 2.00
  2. Begin Form WinSeek 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Dir2DBF"
  6.    ClientHeight    =   3555
  7.    ClientLeft      =   1140
  8.    ClientTop       =   3225
  9.    ClientWidth     =   7080
  10.    ForeColor       =   &H00000080&
  11.    Height          =   3960
  12.    Icon            =   SEEK.FRX:0000
  13.    KeyPreview      =   -1  'True
  14.    Left            =   1080
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   3555
  18.    ScaleWidth      =   7080
  19.    Top             =   2880
  20.    Width           =   7200
  21.    Begin CommandButton cmdWrite 
  22.       Caption         =   "&Write"
  23.       Enabled         =   0   'False
  24.       Height          =   375
  25.       Left            =   5610
  26.       TabIndex        =   19
  27.       Top             =   720
  28.       Width           =   1335
  29.    End
  30.    Begin SSPanel Panel3D1 
  31.       BevelInner      =   1  'Inset
  32.       Height          =   3555
  33.       Left            =   0
  34.       TabIndex        =   2
  35.       Top             =   0
  36.       Width           =   7065
  37.       Begin SSFrame Frame3D1 
  38.          ForeColor       =   &H00000000&
  39.          Height          =   945
  40.          Left            =   5610
  41.          TabIndex        =   17
  42.          Top             =   2280
  43.          Width           =   1335
  44.          Begin SSCheck inclSubs 
  45.             Caption         =   "&Include"
  46.             ForeColor       =   &H00000000&
  47.             Height          =   315
  48.             Left            =   120
  49.             TabIndex        =   15
  50.             Top             =   570
  51.             Width           =   1005
  52.          End
  53.          Begin Label Label4 
  54.             BackStyle       =   0  'Transparent
  55.             Caption         =   "Subdirectories In Search"
  56.             Height          =   555
  57.             Left            =   60
  58.             TabIndex        =   16
  59.             Top             =   120
  60.             Width           =   1245
  61.          End
  62.       End
  63.       Begin TextBox StartDir 
  64.          BackColor       =   &H00C0C0C0&
  65.          BorderStyle     =   0  'None
  66.          Height          =   255
  67.          Left            =   3030
  68.          TabIndex        =   13
  69.          TabStop         =   0   'False
  70.          Text            =   "StartDir"
  71.          Top             =   510
  72.          Width           =   1575
  73.       End
  74.       Begin CommandButton cmdCancel 
  75.          Caption         =   "&Cancel"
  76.          Height          =   375
  77.          Left            =   5610
  78.          TabIndex        =   1
  79.          Top             =   1230
  80.          Width           =   1335
  81.       End
  82.       Begin CommandButton cmdSearch 
  83.          Caption         =   "&Search"
  84.          Height          =   375
  85.          Left            =   5610
  86.          TabIndex        =   0
  87.          Top             =   210
  88.          Width           =   1335
  89.       End
  90.       Begin SSPanel Panel3D6 
  91.          BevelInner      =   1  'Inset
  92.          BevelOuter      =   0  'None
  93.          BevelWidth      =   2
  94.          BorderWidth     =   2
  95.          Height          =   2115
  96.          Left            =   210
  97.          TabIndex        =   10
  98.          Top             =   1140
  99.          Width           =   2520
  100.          Begin FileListBox filList 
  101.             Height          =   1980
  102.             Left            =   60
  103.             TabIndex        =   6
  104.             TabStop         =   0   'False
  105.             Top             =   60
  106.             Width           =   2385
  107.          End
  108.       End
  109.       Begin SSPanel Panel3D5 
  110.          BevelInner      =   1  'Inset
  111.          BevelOuter      =   0  'None
  112.          BevelWidth      =   2
  113.          BorderWidth     =   2
  114.          Height          =   435
  115.          Left            =   210
  116.          TabIndex        =   9
  117.          Top             =   390
  118.          Width           =   2250
  119.          Begin TextBox txtFileSpec 
  120.             Height          =   300
  121.             Left            =   60
  122.             TabIndex        =   3
  123.             Text            =   "*.*"
  124.             Top             =   60
  125.             Width           =   2130
  126.          End
  127.       End
  128.       Begin SSPanel Panel3D4 
  129.          BevelInner      =   1  'Inset
  130.          BevelOuter      =   0  'None
  131.          BevelWidth      =   2
  132.          BorderWidth     =   2
  133.          Height          =   1725
  134.          Left            =   2970
  135.          TabIndex        =   8
  136.          Top             =   750
  137.          Width           =   2535
  138.          Begin DirListBox dirList 
  139.             Height          =   1605
  140.             Left            =   60
  141.             TabIndex        =   4
  142.             Top             =   60
  143.             Width           =   2415
  144.          End
  145.       End
  146.       Begin SSPanel Panel3D3 
  147.          BevelInner      =   1  'Inset
  148.          BevelOuter      =   0  'None
  149.          BevelWidth      =   2
  150.          BorderWidth     =   2
  151.          Height          =   435
  152.          Left            =   2970
  153.          TabIndex        =   7
  154.          Top             =   2820
  155.          Width           =   2535
  156.          Begin DriveListBox drvList 
  157.             Height          =   315
  158.             Left            =   60
  159.             TabIndex        =   5
  160.             Top             =   60
  161.             Width           =   2415
  162.          End
  163.       End
  164.       Begin CommonDialog CMDialog 
  165.          Left            =   4500
  166.          Top             =   1770
  167.       End
  168.       Begin Image Icon 
  169.          Height          =   480
  170.          Left            =   6030
  171.          Picture         =   SEEK.FRX:0302
  172.          Top             =   1800
  173.          Width           =   480
  174.       End
  175.       Begin Label Label5 
  176.          BackColor       =   &H00C0C0C0&
  177.          Caption         =   "Directory Sample"
  178.          Height          =   255
  179.          Left            =   270
  180.          TabIndex        =   18
  181.          Top             =   900
  182.          Width           =   2325
  183.       End
  184.       Begin Label Label3 
  185.          BackColor       =   &H00C0C0C0&
  186.          Caption         =   "Drive:"
  187.          Height          =   225
  188.          Left            =   3030
  189.          TabIndex        =   14
  190.          Top             =   2550
  191.          Width           =   1695
  192.       End
  193.       Begin Label Label2 
  194.          BackColor       =   &H00C0C0C0&
  195.          Caption         =   "Start Directory:"
  196.          Height          =   255
  197.          Left            =   3030
  198.          TabIndex        =   12
  199.          Top             =   150
  200.          Width           =   1815
  201.       End
  202.       Begin Label Label1 
  203.          BackColor       =   &H00C0C0C0&
  204.          Caption         =   "File Specification:"
  205.          Height          =   285
  206.          Left            =   270
  207.          TabIndex        =   11
  208.          Top             =   150
  209.          Width           =   2055
  210.       End
  211.    End
  212.     Dim About As Integer
  213.     Dim Shift, Alt, Ctrl, Txt
  214.     Const SHIFT_MASK = 1
  215.     Const CTRL_MASK = 2
  216.     Const ALT_MASK = 4
  217. Sub cmdCancel_Click ()
  218.     If cmdCancel.Caption = "&Exit" Then Write2File
  219.     Close
  220.     End
  221. End Sub
  222. Sub cmdSearch_Click ()
  223.   txtFileSpec.SetFocus
  224.   ' Update dirList.Path if it is different from the currently
  225.   ' selected directory, otherwise perform the search.
  226.   If dirList.Path <> dirList.List(dirList.ListIndex) Then
  227.      dirList.Path = dirList.List(dirList.ListIndex)
  228.      Exit Sub         ' Exit so user can take a look before searching.
  229.   End If
  230.   Search
  231.   ' Prepare for next search
  232.   WinSeek.dirList.Path = CurDir$
  233.   WinSeek.drvList.Drive = WinSeek.dirList.Path ' Reset DOS path.
  234.   WinSeek.filList.Path = WinSeek.dirList.Path
  235.   Abort = False
  236.   WinSeek.cmdCancel.Enabled = True
  237.   WinSeek.cmdWrite.Enabled = True
  238.   WinSeek.cmdSearch.SetFocus
  239. End Sub
  240. Sub cmdWrite_Click ()
  241.   Write2File
  242.   ' Change Caption of Cancel Button
  243.   WinSeek.cmdCancel.Caption = "&Cancel"
  244.   WinSeek.cmdCancel.Enabled = True
  245. End Sub
  246. Sub DirList_Change ()
  247.     ' Update File listbox to sync with Dir listbox.
  248. On Error GoTo DirHandler
  249.     filList.Path = dirList.Path
  250.     StartDir.Text = dirList.Path
  251.     Exit Sub
  252. DirHandler:
  253.     WinSeek.Show    ' Show Form
  254.     MsgBox "Wrong path entered", , "Error"
  255. End Sub
  256. Sub DirList_LostFocus ()
  257.     dirList.Path = dirList.List(dirList.ListIndex)
  258. End Sub
  259. Sub DrvList_Change ()
  260.     On Error GoTo DriveHandler
  261.     dirList.Path = drvList.Drive
  262.     Exit Sub
  263. DriveHandler:
  264.     WinSeek.Show    ' Show Form
  265.     MsgBox "Wrong drive entered", , "Error"
  266.     drvList.Drive = dirList.Path
  267.     Exit Sub
  268. End Sub
  269. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  270.     ShiftKey = (Shift And SHIFT_MASK) > 0
  271.     AltKey = (Shift And ALT_MASK) > 0
  272.     CtrlKey = (Shift And CTRL_MASK) > 0
  273.     If ShiftKey And CtrlKey And AltKey Then
  274.        About = True
  275.     End If
  276. End Sub
  277. Sub Form_KeyUp (KeyCode As Integer, Shift As Integer)
  278.        About = False
  279. End Sub
  280. Sub Form_Load ()
  281.     Panel3D1.Move 0, 0
  282.     Panel3D1.Width = WinSeek.ScaleWidth
  283.     Panel3D1.BackColor = WinSeek.BackColor
  284.     txtFileSpec.Text = SearchSpec
  285.     If AutoRunFlag = True Then
  286.     WinSeek.Hide                             ' Hide Main form.
  287.     If IncludeSubs = True Then WinSeek.inclSubs.Value = True
  288.     drvList.Drive = DriveSpec
  289.     dirList.Path = DirSpec
  290.     Search
  291.     Write2File
  292.     Close
  293.     Else
  294.     WinSeek.Show
  295.     End If
  296.     StartDir.Text = dirList.Path
  297. End Sub
  298. Sub Form_Unload (Cancel As Integer)
  299.     If cmdCancel.Caption = "&Exit" Then Write2File
  300.     Close
  301.     End
  302. End Sub
  303. Sub Image1_Click ()
  304. If About = True Then
  305.     Msg = "A Directory To dBASEIII-format File translator."
  306.     Msg = Msg & Chr$(13) & Chr$(10)
  307.     Msg = Msg & "
  308.  Imre Fabian, Almere, Nederland."
  309.     Msg = Msg & Chr$(13) & Chr$(10)
  310.     Msg = Msg & "  Partial CopyRight MicroSoft."
  311.     Title = "AboutBox"
  312.     MsgBox Msg, , Title
  313. End If
  314.     About = False
  315. End Sub
  316. Sub txtFileSpec_Change ()
  317. ' Update file list box if user changes pattern.
  318.     filList.Pattern = txtFileSpec.Text
  319. End Sub
  320. Sub txtFileSpec_DblClick ()
  321.     cmdSearch_Click
  322. End Sub
  323. Sub txtFileSpec_GotFocus ()
  324.     txtFileSpec.SelStart = 0      ' Highlight the current entry.
  325.     txtFileSpec.SelLength = Len(txtFileSpec.Text)
  326. End Sub
  327. Sub txtFileSpec_KeyDown (KeyCode As Integer, Shift As Integer)
  328.     If KeyCode = 9 Or KeyCode = 10 Or KeyCode = 13 Then txtFileSpec_DblClick
  329. End Sub
  330.